#ifndef ADDFRIEND_H
#define ADDFRIEND_H

#include <QDialog>
#include <QMessageBox>
#include <QGridLayout>
#include <QDebug>
#include <QLabel>
#include <QTableWidget>
#include <QPixmap>
#include <QHBoxLayout>
#include <QTcpSocket>

namespace Ui {
class addFriend;
}

class addFriend : public QDialog
{
    Q_OBJECT

public:
    explicit addFriend(QWidget *parent = nullptr);
    ~addFriend();
    void getselfaccount(const QString&a);
    QString getfriacc();
    QString getfriendname();
    QString getfriendpic();

    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);

private slots:
    void on_search_btn_clicked();
    void onReadyRead();
    void onConnected();
    void onDisconnected();
    void on_add_btn_clicked();

    void on_toolButton_clicked();

    void on_toolButton_2_clicked();

signals:
    void addsuccess(const QString&pic,const QString&name,const QString&selfacc,const QString&friacc);

private:
    Ui::addFriend *ui;
    QString selfaccount;
    QString fri_account;
    QString fri_name;
    QString fri_pic;
    QString fri_sig;
    QString fri_paw;
    QTcpSocket *tcpsocket;
    QTcpSocket *tcpsocket2;
    int num;
    QPoint windowPos;
    QPoint mousePos;
    QPoint dPos;
};

#endif // ADDFRIEND_H
